﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace bookshop
{
    public partial class AdminLogin : Form
    {
        public AdminLogin()
        {
            InitializeComponent();
        }

        private void label9_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void label4_MouseClick(object sender, MouseEventArgs e)
        {
            this.Hide();
            login obj = new login();
            obj.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (PasswTb.Text == "")
            {
                MessageBox.Show("请输入密码！");
            }
            else
            {
                if (PasswTb.Text == "admin")
                {
                    this.Hide();
                    Books obj = new Books();
                    obj.Show();
                }
                else
                {
                    MessageBox.Show("密码错误！");
                }
            }
        }

        private void PasswTb_KeyDown(object sender, KeyEventArgs e)
        {
            if(e.KeyCode == Keys.Enter)
            {
                button1_Click(sender, e);
            }
        }
    }
}
